<!DOCTYPE html>
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	    <meta name="format-detection" content="telephone=no">
	    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
	    <link href="../../../css/bootstrap.css" rel="stylesheet" />
	    <link href="../../../css/cover.css" rel="stylesheet" />
	    <link href="../../../css/font-awesome.min.css" rel="stylesheet" />
	    <title>荆州千网汇信息科技有限公司</title>
	    <script src="../../../js/jquery-2.2.3.min.js"></script>
	    <script src="../../../js/jquery.flexslider-min.js"></script>
	    <script src="../../../js/rem.js"></script>
	    <script src="../../../js/itnetcao.js"></script>
	    <link href="../../../js/layui/css/layui.css" rel="stylesheet" />
	    <link href="../../../js/donghua/animsition.min.css" rel="stylesheet" />
	    <script src="../../../js/donghua/animsition.min.js"></script>
	    <link rel="stylesheet" href="../../../css/minirefresh.css" />
	    <link rel="stylesheet" href="../../../css/common.css" />
	    <script type="text/javascript" src="../../../js/minirefresh.js"></script>
	    <script type="text/javascript" src="../../../js/common.js"></script>
	    <script type="text/javascript" src="../../../js/layer.js"></script>
		<style type="text/css">
		*{
			margin: 0px;
			padding: 0px;
			font-family:"微软雅黑"
		}
		</style>
	</head>
	<body>
	
		<div class="page_top01 relative">
            <h3 class="text-center">银行卡信息</h3>
            <a href="javascript:;" class="animsition-link" data-animsition-out-class="fade-out-right" data-animsition-out-duration="500" onclick="history.go(-1)">
                <img src="../../../images/icon_left.png" class="img-responsive reture_img" /></a>
        </div>
	
		
		<div class="layui-fluid layui-form layui-form-pane">
			<div class="layui-row layui-col-space15">
				
				<div class="layui-col-xs12">
					<div class="layui-form-item">
					    <label class="layui-form-label">银行卡卡号</label>
					    <div class="layui-input-block">
							<input type="text" name="proKey" disabled placeholder="请输入银行卡卡号" class="layui-input">
					    </div>
					</div>
				</div>
				
				<div class="layui-col-xs12">
					<div class="layui-form-item">
					    <label class="layui-form-label">开户行</label>
					    <div class="layui-input-block">
							<input type="text" name="proValue" disabled placeholder="请输入银行开户行" class="layui-input">
					    </div>
					</div>
				</div>
				
				<div class="layui-col-xs12">
					<button class="layui-btn layui-btn-warm saveOrUpdate" style='width:100%;'>保存</button>
				</div>
				
			</div>
		</div>
<script type='text/javascript'>
var userId = jQuery.parseJSON(localStorage.getItem("miningmachine_user")).userId;

url = localStorage.getItem("url") + "/user/controller/UserPropertyFindByIdAndTypeAPP.do";
data = "propertyType=3&userId=" + userId;
var dataId = null;
itcao.itGetAjaxBigData(url, data).done(function(result) {
	var json = jQuery.parseJSON(result);
	if(json.state == true) {
		var j = json.bean;
		dataId = j.proId
		$("input[name='proKey']").val(j.proKey);
		$("input[name='proValue']").val(j.proValue);
	}else {
		$("input").removeAttr("disabled");
	}
})


$(function () {
	$(".saveOrUpdate").click(function() {
		data = "proType=3&proUserId=" + userId + "&proKey=" + $("input[name='proKey']").val().trim()
				+ "&proValue=" + $("input[name='proValue']").val().trim();
		if(dataId == null) {
			url = localStorage.getItem("url") + "/user/controller/UserPropertySaveAPP.do";
		}else {
			url = localStorage.getItem("url") + "/user/controller/UpdateUserPropertyAPP.do";
			data = data + "&proId=" + dataId;
		}
		
		itcao.itGetAjaxBigData(url, data).done(function(result) {
			var json = jQuery.parseJSON(result);
			if(json.state == true) {
				alert("保存或修改成功");
				setTimeout(function() {
					window.location.href = "../set.html";
				}, 500)
			}else {
				alert(json.value);
			}
		})
	})
})
</script>
	</body>
</html>
